package com.bwie.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bwie.pojo.Coupon;
import com.bwie.service.CouponService;
import com.bwie.mapper.CouponMapper;
import com.bwie.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Yoo19
* @description 针对表【coupon】的数据库操作Service实现
* @createDate 2025-07-11 10:07:01
*/
@Service
public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon>
    implements CouponService{
    @Autowired
    private CouponMapper couponMapper;
    @Override
    public R getCouponList(Integer customerId) {
        List<Coupon> couponList = couponMapper.selectList(new LambdaQueryWrapper<Coupon>().eq(Coupon::getCustomerId, customerId));
        return R.OK(couponList);
    }
}




